package com.thread.learn.thread2;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Demo6 {
	
	public static void main(String[] args) throws InterruptedException, ExecutionException {
		
		ExecutorService threadPool=Executors.newFixedThreadPool(10);
		for (int i=0;i<10;i++) {
			threadPool.execute(new Runnable() {
				public void run() {
					System.out.println(Thread.currentThread().getName());				
				}
			});
		}
		
		threadPool.shutdown();
		
	}
	
	
}
